package com.igrowing.api.apitest.controller;


import com.igrowing.api.apitest.model.Animal;
import com.igrowing.api.apitest.model.UserTest;


import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * Description:    // 类说明
 *
 * @ClassName: testCOntroller    // 类名，会自动填充
 * @Author: 周天赐        // 创建者
 * @Email: m18879004515@163.com
 * @Date: 2024/2/28 13:06   // 时间
 * @Version: 1.0     // 版本
 */
@RestController
@RequestMapping("/name")
public class testController {
    @PostMapping("/user")
    public String getNameByJson(@RequestBody UserTest user , HttpServletRequest request){

        System.out.println("Json , 你的名字是"+user.getName());

        return "Json , 你的名字是"+user.getName();
    }

    @PostMapping("/animal")
    public String getAnimal(@RequestBody Animal animal , HttpServletRequest request)
    {
        System.out.println(animal.toString());
        return animal.toString();
    }

}

    
    
